mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
[UpdateTestChecks] include { in function signature check line
After D85099, if we have attribute group in the function signature that hasn't been seen before, and later a callsite with the same attribute group, filecheck will evaluate the first attribute group to for example '#0 {'. We now include { in the args_and_sig group to avoid this. Differential Revision: https://reviews.llvm.org/D86769
This commit is contained in:
parent
312a4e2369
commit
0afdba7e67
@ -3,7 +3,7 @@
|
||||
|
||||
define i32 @reuse_arg_names(i32 %X, i32 %Y) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@reuse_arg_names
|
||||
; CHECK-SAME: (i32 [[X:%.*]], i32 [[Y:%.*]])
|
||||
; CHECK-SAME: (i32 [[X:%.*]], i32 [[Y:%.*]]) {
|
||||
; CHECK-NEXT: [[Z:%.*]] = sub i32 [[X]], [[Y]]
|
||||
; CHECK-NEXT: [[Q:%.*]] = add i32 [[Z]], [[Y]]
|
||||
; CHECK-NEXT: ret i32 [[Q]]
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
define i32 @common_sub_operand(i32 %X, i32 %Y) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@common_sub_operand
|
||||
; CHECK-SAME: (i32 [[X:%.*]], i32 [[Y:%.*]])
|
||||
; CHECK-SAME: (i32 [[X:%.*]], i32 [[Y:%.*]]) {
|
||||
; CHECK-NEXT: ret i32 [[X]]
|
||||
;
|
||||
%Z = sub i32 %X, %Y
|
||||
@ -14,7 +14,7 @@ define i32 @common_sub_operand(i32 %X, i32 %Y) {
|
||||
|
||||
define i32 @negated_operand(i32 %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@negated_operand
|
||||
; CHECK-SAME: (i32 [[X:%.*]])
|
||||
; CHECK-SAME: (i32 [[X:%.*]]) {
|
||||
; CHECK-NEXT: ret i32 0
|
||||
;
|
||||
%negx = sub i32 0, %x
|
||||
@ -24,7 +24,7 @@ define i32 @negated_operand(i32 %x) {
|
||||
|
||||
define <2 x i32> @negated_operand_commute_vec(<2 x i32> %x) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@negated_operand_commute_vec
|
||||
; CHECK-SAME: (<2 x i32> [[X:%.*]])
|
||||
; CHECK-SAME: (<2 x i32> [[X:%.*]]) {
|
||||
; CHECK-NEXT: ret <2 x i32> zeroinitializer
|
||||
;
|
||||
%negx = sub <2 x i32> zeroinitializer, %x
|
||||
@ -34,7 +34,7 @@ define <2 x i32> @negated_operand_commute_vec(<2 x i32> %x) {
|
||||
|
||||
define i8 @knownnegation(i8 %x, i8 %y) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@knownnegation
|
||||
; CHECK-SAME: (i8 [[X:%.*]], i8 [[Y:%.*]])
|
||||
; CHECK-SAME: (i8 [[X:%.*]], i8 [[Y:%.*]]) {
|
||||
; CHECK-NEXT: ret i8 0
|
||||
;
|
||||
%xy = sub i8 %x, %y
|
||||
@ -45,7 +45,7 @@ define i8 @knownnegation(i8 %x, i8 %y) {
|
||||
|
||||
define <2 x i8> @knownnegation_commute_vec(<2 x i8> %x, <2 x i8> %y) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@knownnegation_commute_vec
|
||||
; CHECK-SAME: (<2 x i8> [[X:%.*]], <2 x i8> [[Y:%.*]])
|
||||
; CHECK-SAME: (<2 x i8> [[X:%.*]], <2 x i8> [[Y:%.*]]) {
|
||||
; CHECK-NEXT: ret <2 x i8> zeroinitializer
|
||||
;
|
||||
%xy = sub <2 x i8> %x, %y
|
||||
@ -56,7 +56,7 @@ define <2 x i8> @knownnegation_commute_vec(<2 x i8> %x, <2 x i8> %y) {
|
||||
|
||||
define i32 @nameless_value(i32 %X) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@nameless_value
|
||||
; CHECK-SAME: (i32 [[X:%.*]])
|
||||
; CHECK-SAME: (i32 [[X:%.*]]) {
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = sub i32 42, [[X]]
|
||||
; CHECK-NEXT: ret i32 [[TMP1]]
|
||||
;
|
||||
|
@ -10,14 +10,14 @@
|
||||
define i32* @foo(%struct.ST* %s) nounwind uwtable readnone optsize ssp {
|
||||
; IS__TUNIT____: Function Attrs: nofree nosync nounwind optsize readnone ssp uwtable willreturn
|
||||
; IS__TUNIT____-LABEL: define {{[^@]+}}@foo
|
||||
; IS__TUNIT____-SAME: (%struct.ST* nofree readnone [[S:%.*]]) [[ATTR0:#.*]]
|
||||
; IS__TUNIT____-SAME: (%struct.ST* nofree readnone [[S:%.*]]) [[ATTR0:#.*]] {
|
||||
; IS__TUNIT____-NEXT: entry:
|
||||
; IS__TUNIT____-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13
|
||||
; IS__TUNIT____-NEXT: ret i32* [[ARRAYIDX]]
|
||||
;
|
||||
; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn
|
||||
; IS__CGSCC____-LABEL: define {{[^@]+}}@foo
|
||||
; IS__CGSCC____-SAME: (%struct.ST* nofree readnone [[S:%.*]]) [[ATTR0:#.*]]
|
||||
; IS__CGSCC____-SAME: (%struct.ST* nofree readnone [[S:%.*]]) [[ATTR0:#.*]] {
|
||||
; IS__CGSCC____-NEXT: entry:
|
||||
; IS__CGSCC____-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13
|
||||
; IS__CGSCC____-NEXT: ret i32* [[ARRAYIDX]]
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
define i32* @foo(%struct.ST* %s) nounwind uwtable readnone optsize ssp {
|
||||
; CHECK-LABEL: define {{[^@]+}}@foo
|
||||
; CHECK-SAME: (%struct.ST* nofree readnone [[S:%.*]]) [[ATTR0:#.*]]
|
||||
; CHECK-SAME: (%struct.ST* nofree readnone [[S:%.*]]) [[ATTR0:#.*]] {
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [[STRUCT_ST:%.*]], %struct.ST* [[S]], i64 1, i32 2, i32 1, i64 5, i64 13
|
||||
; CHECK-NEXT: ret i32* [[ARRAYIDX]]
|
||||
|
@ -4,7 +4,7 @@
|
||||
declare void @foo()
|
||||
|
||||
define void @check_lines_1() {
|
||||
; CHECK-LABEL: define {{[^@]+}}@check_lines_1()
|
||||
; CHECK-LABEL: define {{[^@]+}}@check_lines_1() {
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
ret void
|
||||
@ -21,14 +21,14 @@ define void @no_check_lines() {
|
||||
; UTC_ARGS: --enable
|
||||
|
||||
define void @check_lines_2() {
|
||||
; CHECK-LABEL: define {{[^@]+}}@check_lines_2()
|
||||
; CHECK-LABEL: define {{[^@]+}}@check_lines_2() {
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @scrub() {
|
||||
; CHECK-LABEL: define {{[^@]+}}@scrub()
|
||||
; CHECK-LABEL: define {{[^@]+}}@scrub() {
|
||||
; CHECK-NEXT: call void @foo()
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
@ -38,7 +38,7 @@ define void @scrub() {
|
||||
|
||||
define i32 @signature(i32 %arg) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@signature
|
||||
; CHECK-SAME: (i32 [[ARG:%.*]])
|
||||
; CHECK-SAME: (i32 [[ARG:%.*]]) {
|
||||
; CHECK-NEXT: ret i32 [[ARG]]
|
||||
;
|
||||
ret i32 %arg
|
||||
|
@ -18,14 +18,14 @@ define void @no_check_lines() {
|
||||
; UTC_ARGS: --enable
|
||||
|
||||
define void @check_lines_2() {
|
||||
; CHECK-LABEL: define {{[^@]+}}@check_lines_2()
|
||||
; CHECK-LABEL: define {{[^@]+}}@check_lines_2() {
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @scrub() {
|
||||
; CHECK-LABEL: define {{[^@]+}}@scrub()
|
||||
; CHECK-LABEL: define {{[^@]+}}@scrub() {
|
||||
; CHECK-NEXT: call void @foo()
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
@ -35,7 +35,7 @@ define void @scrub() {
|
||||
|
||||
define i32 @signature(i32 %arg) {
|
||||
; CHECK-LABEL: define {{[^@]+}}@signature
|
||||
; CHECK-SAME: (i32 [[ARG:%.*]])
|
||||
; CHECK-SAME: (i32 [[ARG:%.*]]) {
|
||||
; CHECK-NEXT: ret i32 [[ARG]]
|
||||
;
|
||||
ret i32 %arg
|
||||
|
@ -10,7 +10,7 @@ target triple = "x86_64-unknown-linux-gnu"
|
||||
; Function Attrs: nounwind uwtable
|
||||
define dso_local void @foo(i32* %A) #0 !dbg !7 {
|
||||
; CHECK-LABEL: define {{[^@]+}}@foo
|
||||
; CHECK-SAME: (i32* [[A:%.*]]) [[ATTR0:#.*]] [[DBG7:!dbg !.*]]
|
||||
; CHECK-SAME: (i32* [[A:%.*]]) [[ATTR0:#.*]] [[DBG7:!dbg !.*]] {
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 8
|
||||
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
|
||||
@ -99,7 +99,7 @@ declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #2
|
||||
; Function Attrs: nounwind uwtable
|
||||
define dso_local void @bar(i32* %A) #0 !dbg !39 {
|
||||
; CHECK-LABEL: define {{[^@]+}}@bar
|
||||
; CHECK-SAME: (i32* [[A:%.*]]) [[ATTR0]] [[DBG39:!dbg !.*]]
|
||||
; CHECK-SAME: (i32* [[A:%.*]]) [[ATTR0]] [[DBG39:!dbg !.*]] {
|
||||
; CHECK-NEXT: entry:
|
||||
; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32*, align 8
|
||||
; CHECK-NEXT: [[I:%.*]] = alloca i32, align 4
|
||||
|
@ -146,7 +146,7 @@ UTC_ADVERT = 'NOTE: Assertions have been autogenerated by '
|
||||
|
||||
OPT_FUNCTION_RE = re.compile(
|
||||
r'^(\s*;\s*Function\sAttrs:\s(?P<attrs>[\w\s]+?))?\s*define\s+(?:internal\s+)?[^@]*@(?P<func>[\w.-]+?)\s*'
|
||||
r'(?P<args_and_sig>\((\)|(.*?[\w.-]+?)\))[^{]*)\{\n(?P<body>.*?)^\}$',
|
||||
r'(?P<args_and_sig>\((\)|(.*?[\w.-]+?)\))[^{]*\{)\n(?P<body>.*?)^\}$',
|
||||
flags=(re.M | re.S))
|
||||
|
||||
ANALYZE_FUNCTION_RE = re.compile(
|
||||
|
Loading…
Reference in New Issue
Block a user