r213334 - Check-labelize ubsan tests

Alexey Samsonov vonosmas at gmail.com
Thu Jul 17 16:53:44 PDT 2014


Author: samsonov
Date: Thu Jul 17 18:53:44 2014
New Revision: 213334

URL: http://llvm.org/viewvc/llvm-project?rev=213334&view=rev
Log:
Check-labelize ubsan tests

Modified:
    cfe/trunk/test/CodeGen/catch-undef-behavior.c
    cfe/trunk/test/CodeGenCXX/catch-undef-behavior.cpp

Modified: cfe/trunk/test/CodeGen/catch-undef-behavior.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/catch-undef-behavior.c?rev=213334&r1=213333&r2=213334&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/catch-undef-behavior.c (original)
+++ cfe/trunk/test/CodeGen/catch-undef-behavior.c Thu Jul 17 18:53:44 2014
@@ -22,9 +22,9 @@
 // CHECK-NULL: @[[LINE_100:.*]] = private unnamed_addr global {{.*}}, i32 100, i32 5 {{.*}}
 
 // PR6805
-// CHECK: @foo
-// CHECK-NULL: @foo
-// CHECK-TRAP: @foo
+// CHECK-LABEL: @foo
+// CHECK-NULL-LABEL: @foo
+// CHECK-TRAP-LABEL: @foo
 void foo() {
   union { int i; } u;
   // CHECK:      %[[CHECK0:.*]] = icmp ne {{.*}}* %[[PTR:.*]], null
@@ -68,8 +68,8 @@ void foo() {
   u.i=1;
 }
 
-// CHECK: @bar
-// CHECK-TRAP: @bar
+// CHECK-LABEL: @bar
+// CHECK-TRAP-LABEL: @bar
 int bar(int *a) {
   // CHECK:      %[[SIZE:.*]] = call i64 @llvm.objectsize.i64
   // CHECK-NEXT: icmp uge i64 %[[SIZE]], 4
@@ -95,14 +95,14 @@ int bar(int *a) {
   return *a;
 }
 
-// CHECK: @addr_space
+// CHECK-LABEL: @addr_space
 int addr_space(int __attribute__((address_space(256))) *a) {
   // CHECK-NOT: __ubsan
   return *a;
 }
 
-// CHECK: @lsh_overflow
-// CHECK-TRAP: @lsh_overflow
+// CHECK-LABEL: @lsh_overflow
+// CHECK-TRAP-LABEL: @lsh_overflow
 int lsh_overflow(int a, int b) {
   // CHECK:      %[[INBOUNDS:.*]] = icmp ule i32 %[[RHS:.*]], 31
   // CHECK-NEXT: br i1 %[[INBOUNDS]], label %[[CHECKBB:.*]], label %[[CONTBB:.*]]
@@ -145,8 +145,8 @@ int lsh_overflow(int a, int b) {
   return a << b;
 }
 
-// CHECK: @rsh_inbounds
-// CHECK-TRAP: @rsh_inbounds
+// CHECK-LABEL: @rsh_inbounds
+// CHECK-TRAP-LABEL: @rsh_inbounds
 int rsh_inbounds(int a, int b) {
   // CHECK:      %[[INBOUNDS:.*]] = icmp ule i32 %[[RHS:.*]], 31
   // CHECK:      br i1 %[[INBOUNDS]]
@@ -170,8 +170,8 @@ int rsh_inbounds(int a, int b) {
   return a >> b;
 }
 
-// CHECK: @load
-// CHECK-TRAP: @load
+// CHECK-LABEL: @load
+// CHECK-TRAP-LABEL: @load
 int load(int *p) {
   // CHECK: call void @__ubsan_handle_type_mismatch(i8* bitcast ({{.*}} @[[LINE_500]] to i8*), i64 %{{.*}})
 
@@ -181,8 +181,8 @@ int load(int *p) {
   return *p;
 }
 
-// CHECK: @store
-// CHECK-TRAP: @store
+// CHECK-LABEL: @store
+// CHECK-TRAP-LABEL: @store
 void store(int *p, int q) {
   // CHECK: call void @__ubsan_handle_type_mismatch(i8* bitcast ({{.*}} @[[LINE_600]] to i8*), i64 %{{.*}})
 
@@ -194,8 +194,8 @@ void store(int *p, int q) {
 
 struct S { int k; };
 
-// CHECK: @member_access
-// CHECK-TRAP: @member_access
+// CHECK-LABEL: @member_access
+// CHECK-TRAP-LABEL: @member_access
 int *member_access(struct S *p) {
   // CHECK: call void @__ubsan_handle_type_mismatch(i8* bitcast ({{.*}} @[[LINE_700]] to i8*), i64 %{{.*}})
 
@@ -205,8 +205,8 @@ int *member_access(struct S *p) {
   return &p->k;
 }
 
-// CHECK: @signed_overflow
-// CHECK-TRAP: @signed_overflow
+// CHECK-LABEL: @signed_overflow
+// CHECK-TRAP-LABEL: @signed_overflow
 int signed_overflow(int a, int b) {
   // CHECK:      %[[ARG1:.*]] = zext
   // CHECK-NEXT: %[[ARG2:.*]] = zext
@@ -218,8 +218,8 @@ int signed_overflow(int a, int b) {
   return a + b;
 }
 
-// CHECK: @no_return
-// CHECK-TRAP: @no_return
+// CHECK-LABEL: @no_return
+// CHECK-TRAP-LABEL: @no_return
 int no_return() {
   // Reaching the end of a noreturn function is fine in C.
   // FIXME: If the user explicitly requests -fsanitize=return, we should catch
@@ -233,7 +233,7 @@ int no_return() {
   // CHECK-TRAP: ret i32
 }
 
-// CHECK: @vla_bound
+// CHECK-LABEL: @vla_bound
 void vla_bound(int n) {
   // CHECK:      icmp sgt i32 %[[PARAM:.*]], 0
   //
@@ -243,14 +243,14 @@ void vla_bound(int n) {
   int arr[n * 3];
 }
 
-// CHECK: @int_float_no_overflow
+// CHECK-LABEL: @int_float_no_overflow
 float int_float_no_overflow(__int128 n) {
   // CHECK-NOT: call void @__ubsan_handle
   return n;
 }
 
-// CHECK: @int_float_overflow
-// CHECK-TRAP: @int_float_overflow
+// CHECK-LABEL: @int_float_overflow
+// CHECK-TRAP-LABEL: @int_float_overflow
 float int_float_overflow(unsigned __int128 n) {
   // This is 2**104. FLT_MAX is 2**128 - 2**104.
   // CHECK: icmp ule i128 %{{.*}}, -20282409603651670423947251286016
@@ -264,8 +264,8 @@ float int_float_overflow(unsigned __int1
   return n;
 }
 
-// CHECK: @int_fp16_overflow
-// CHECK-TRAP: @int_fp16_overflow
+// CHECK-LABEL: @int_fp16_overflow
+// CHECK-TRAP-LABEL: @int_fp16_overflow
 void int_fp16_overflow(int n, __fp16 *p) {
   // CHECK: %[[GE:.*]] = icmp sge i32 %{{.*}}, -65504
   // CHECK: %[[LE:.*]] = icmp sle i32 %{{.*}}, 65504
@@ -282,8 +282,8 @@ void int_fp16_overflow(int n, __fp16 *p)
   *p = n;
 }
 
-// CHECK: @float_int_overflow
-// CHECK-TRAP: @float_int_overflow
+// CHECK-LABEL: @float_int_overflow
+// CHECK-TRAP-LABEL: @float_int_overflow
 int float_int_overflow(float f) {
   // CHECK: %[[GE:.*]] = fcmp ogt float %[[F:.*]], 0xC1E0000020000000
   // CHECK: %[[LE:.*]] = fcmp olt float %[[F]], 0x41E0000000000000
@@ -303,8 +303,8 @@ int float_int_overflow(float f) {
   return f;
 }
 
-// CHECK: @long_double_int_overflow
-// CHECK-TRAP: @long_double_int_overflow
+// CHECK-LABEL: @long_double_int_overflow
+// CHECK-TRAP-LABEL: @long_double_int_overflow
 int long_double_int_overflow(long double ld) {
   // CHECK: alloca x86_fp80
   // CHECK: %[[GE:.*]] = fcmp ogt x86_fp80 %[[F:.*]], 0xKC01E8000000100000000
@@ -325,8 +325,8 @@ int long_double_int_overflow(long double
   return ld;
 }
 
-// CHECK: @float_uint_overflow
-// CHECK-TRAP: @float_uint_overflow
+// CHECK-LABEL: @float_uint_overflow
+// CHECK-TRAP-LABEL: @float_uint_overflow
 unsigned float_uint_overflow(float f) {
   // CHECK: %[[GE:.*]] = fcmp ogt float %[[F:.*]], -1.{{0*}}e+00
   // CHECK: %[[LE:.*]] = fcmp olt float %[[F]], 0x41F0000000000000
@@ -343,8 +343,8 @@ unsigned float_uint_overflow(float f) {
   return f;
 }
 
-// CHECK: @fp16_char_overflow
-// CHECK-TRAP: @fp16_char_overflow
+// CHECK-LABEL: @fp16_char_overflow
+// CHECK-TRAP-LABEL: @fp16_char_overflow
 signed char fp16_char_overflow(__fp16 *p) {
   // CHECK: %[[GE:.*]] = fcmp ogt float %[[F:.*]], -1.29{{0*}}e+02
   // CHECK: %[[LE:.*]] = fcmp olt float %[[F]], 1.28{{0*}}e+02
@@ -361,8 +361,8 @@ signed char fp16_char_overflow(__fp16 *p
   return *p;
 }
 
-// CHECK: @float_float_overflow
-// CHECK-TRAP: @float_float_overflow
+// CHECK-LABEL: @float_float_overflow
+// CHECK-TRAP-LABEL: @float_float_overflow
 float float_float_overflow(double f) {
   // CHECK: %[[F:.*]] = call double @llvm.fabs.f64(
   // CHECK: %[[GE:.*]] = fcmp ogt double %[[F]], 0x47EFFFFFE0000000
@@ -382,8 +382,8 @@ float float_float_overflow(double f) {
   return f;
 }
 
-// CHECK:          @int_divide_overflow
-// CHECK-OVERFLOW: @int_divide_overflow
+// CHECK-LABEL:          @int_divide_overflow
+// CHECK-OVERFLOW-LABEL: @int_divide_overflow
 int int_divide_overflow(int a, int b) {
   // CHECK:               %[[ZERO:.*]] = icmp ne i32 %[[B:.*]], 0
   // CHECK-OVERFLOW-NOT:  icmp ne i32 %{{.*}}, 0
@@ -418,7 +418,7 @@ int int_divide_overflow(int a, int b) {
   // CHECK-TRAP:     }
 }
 
-// CHECK: @sour_bool
+// CHECK-LABEL: @sour_bool
 _Bool sour_bool(_Bool *p) {
   // CHECK: %[[OK:.*]] = icmp ule i8 {{.*}}, 1
   // CHECK: br i1 %[[OK]]

Modified: cfe/trunk/test/CodeGenCXX/catch-undef-behavior.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/catch-undef-behavior.cpp?rev=213334&r1=213333&r2=213334&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/catch-undef-behavior.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/catch-undef-behavior.cpp Thu Jul 17 18:53:44 2014
@@ -8,7 +8,7 @@ struct S {
 
 struct T : S {};
 
-// CHECK: @_Z17reference_binding
+// CHECK-LABEL: @_Z17reference_binding
 void reference_binding(int *p, S *q) {
   // C++ core issue 453: If an lvalue to which a reference is directly bound
   // designates neither an existing object or function of an appropriate type,
@@ -30,7 +30,7 @@ void reference_binding(int *p, S *q) {
   S &r2 = *q;
 }
 
-// CHECK: @_Z13member_access
+// CHECK-LABEL: @_Z13member_access
 void member_access(S *p) {
   // (1a) Check 'p' is appropriately sized and aligned for member access.
 
@@ -117,7 +117,7 @@ void member_access(S *p) {
   k = p->f();
 }
 
-// CHECK: @_Z12lsh_overflow
+// CHECK-LABEL: @_Z12lsh_overflow
 int lsh_overflow(int a, int b) {
   // CHECK: %[[INBOUNDS:.*]] = icmp ule i32 %[[RHS:.*]], 31
   // CHECK-NEXT: br i1 %[[INBOUNDS]]
@@ -142,13 +142,13 @@ int lsh_overflow(int a, int b) {
   return a << b;
 }
 
-// CHECK: @_Z9no_return
+// CHECK-LABEL: @_Z9no_return
 int no_return() {
   // CHECK:      call void @__ubsan_handle_missing_return(i8* bitcast ({{.*}}* @{{.*}} to i8*)) [[NR_NUW:#[0-9]+]]
   // CHECK-NEXT: unreachable
 }
 
-// CHECK: @_Z9sour_bool
+// CHECK-LABEL: @_Z9sour_bool
 bool sour_bool(bool *p) {
   // CHECK: %[[OK:.*]] = icmp ule i8 {{.*}}, 1
   // CHECK: br i1 %[[OK]]
@@ -160,7 +160,7 @@ enum E1 { e1a = 0, e1b = 127 } e1;
 enum E2 { e2a = -1, e2b = 64 } e2;
 enum E3 { e3a = (1u << 31) - 1 } e3;
 
-// CHECK: @_Z14bad_enum_value
+// CHECK-LABEL: @_Z14bad_enum_value
 int bad_enum_value() {
   // CHECK: %[[E1:.*]] = icmp ule i32 {{.*}}, 127
   // CHECK: br i1 %[[E1]]
@@ -181,7 +181,7 @@ int bad_enum_value() {
   return a + b + c;
 }
 
-// CHECK: @_Z20bad_downcast_pointer
+// CHECK-LABEL: @_Z20bad_downcast_pointer
 void bad_downcast_pointer(S *p) {
   // CHECK: %[[NONNULL:.*]] = icmp ne {{.*}}, null
   // CHECK: br i1 %[[NONNULL]],
@@ -203,7 +203,7 @@ void bad_downcast_pointer(S *p) {
   (void) static_cast<T*>(p);
 }
 
-// CHECK: @_Z22bad_downcast_reference
+// CHECK-LABEL: @_Z22bad_downcast_reference
 void bad_downcast_reference(S &p) {
   // CHECK: %[[E1:.*]] = icmp ne {{.*}}, null
   // CHECK-NOT: br i1
@@ -225,7 +225,7 @@ void bad_downcast_reference(S &p) {
   (void) static_cast<T&>(p);
 }
 
-// CHECK: @_Z11array_index
+// CHECK-LABEL: @_Z11array_index
 int array_index(const int (&a)[4], int n) {
   // CHECK: %[[K1_OK:.*]] = icmp ult i64 %{{.*}}, 4
   // CHECK: br i1 %[[K1_OK]]
@@ -250,7 +250,7 @@ int array_index(const int (&a)[4], int n
   return k1 + *r1 + k2;
 }
 
-// CHECK: @_Z17multi_array_index
+// CHECK-LABEL: @_Z17multi_array_index
 int multi_array_index(int n, int m) {
   int arr[4][6];
 
@@ -264,7 +264,7 @@ int multi_array_index(int n, int m) {
   return arr[n][m];
 }
 
-// CHECK: @_Z11array_arith
+// CHECK-LABEL: @_Z11array_arith
 int array_arith(const int (&a)[4], int n) {
   // CHECK: %[[K1_OK:.*]] = icmp ule i64 %{{.*}}, 4
   // CHECK: br i1 %[[K1_OK]]
@@ -283,7 +283,7 @@ struct ArrayMembers {
   int a1[5];
   int a2[1];
 };
-// CHECK: @_Z18struct_array_index
+// CHECK-LABEL: @_Z18struct_array_index
 int struct_array_index(ArrayMembers *p, int n) {
   // CHECK: %[[IDX_OK:.*]] = icmp ult i64 %{{.*}}, 5
   // CHECK: br i1 %[[IDX_OK]]
@@ -291,21 +291,21 @@ int struct_array_index(ArrayMembers *p,
   return p->a1[n];
 }
 
-// CHECK: @_Z16flex_array_index
+// CHECK-LABEL: @_Z16flex_array_index
 int flex_array_index(ArrayMembers *p, int n) {
   // CHECK-NOT: call void @__ubsan_handle_out_of_bounds(
   return p->a2[n];
 }
 
 extern int incomplete[];
-// CHECK: @_Z22incomplete_array_index
+// CHECK-LABEL: @_Z22incomplete_array_index
 int incomplete_array_index(int n) {
   // CHECK-NOT: call void @__ubsan_handle_out_of_bounds(
   return incomplete[n];
 }
 
 typedef __attribute__((ext_vector_type(4))) int V4I;
-// CHECK: @_Z12vector_index
+// CHECK-LABEL: @_Z12vector_index
 int vector_index(V4I v, int n) {
   // CHECK: %[[IDX_OK:.*]] = icmp ult i64 %{{.*}}, 4
   // CHECK: br i1 %[[IDX_OK]]
@@ -313,7 +313,7 @@ int vector_index(V4I v, int n) {
   return v[n];
 }
 
-// CHECK: @_Z12string_index
+// CHECK-LABEL: @_Z12string_index
 char string_index(int n) {
   // CHECK: %[[IDX_OK:.*]] = icmp ult i64 %{{.*}}, 6
   // CHECK: br i1 %[[IDX_OK]]





More information about the cfe-commits mailing list