[cfe-commits] r61770 - in /cfe/trunk/test: CodeGen/ext-vector.c CodeGen/ocu-vector.c Parser/ext_vector_components.c Parser/ocu_vector_components.c

Chris Lattner sabre at nondot.org
Mon Jan 5 15:10:19 PST 2009


Author: lattner
Date: Mon Jan  5 17:10:19 2009
New Revision: 61770

URL: http://llvm.org/viewvc/llvm-project?rev=61770&view=rev
Log:
rename these tests to match the attribute.

Added:
    cfe/trunk/test/CodeGen/ext-vector.c
      - copied unchanged from r61769, cfe/trunk/test/CodeGen/ocu-vector.c
    cfe/trunk/test/Parser/ext_vector_components.c
      - copied unchanged from r61764, cfe/trunk/test/Parser/ocu_vector_components.c
Removed:
    cfe/trunk/test/CodeGen/ocu-vector.c
    cfe/trunk/test/Parser/ocu_vector_components.c

Removed: cfe/trunk/test/CodeGen/ocu-vector.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ocu-vector.c?rev=61769&view=auto

==============================================================================
--- cfe/trunk/test/CodeGen/ocu-vector.c (original)
+++ cfe/trunk/test/CodeGen/ocu-vector.c (removed)
@@ -1,121 +0,0 @@
-// RUN: clang -emit-llvm %s -o %t
-
-typedef __attribute__(( ext_vector_type(4) )) float float4;
-typedef __attribute__(( ext_vector_type(2) )) float float2;
-typedef __attribute__(( ext_vector_type(4) )) int int4;
-
-float4 foo = (float4){ 1.0, 2.0, 3.0, 4.0 };
-
-float4 test1(float4 V) {
-  return V.wzyx+V;
-}
-
-float2 vec2, vec2_2;
-float4 vec4, vec4_2;
-float f;
-
-void test2() {
-    vec2 = vec4.rg;  // shorten
-    f = vec2.x;      // extract elt
-    vec4 = vec4.yyyy;  // splat
-    
-    vec2.x = f;      // insert one.
-    vec2.yx = vec2; // reverse
-}
-
-void test3(float4 *out) {
-  *out = ((float4) {1.0f, 2.0f, 3.0f, 4.0f });
-}
-
-void test4(float4 *out) {
-  float a = 1.0f;
-  float b = 2.0f;
-  float c = 3.0f;
-  float d = 4.0f;
-  *out = ((float4) {a,b,c,d});
-}
-
-void test5(float4 *out) {
-  float a;
-  float4 b;
-  
-  a = 1.0f;
-  b = a;
-  b = b * 5.0f;
-  b = 5.0f * b;
-  b *= a;
-  
-  *out = b;
-}
-
-void test6(float4 *ap, float4 *bp, float c) {
-  float4 a = *ap;
-  float4 b = *bp;
-  
-  a = a + b;
-  a = a - b;
-  a = a * b;
-  a = a / b;
-  
-  a = a + c;
-  a = a - c;
-  a = a * c;
-  a = a / c;
-
-  a += b;
-  a -= b;
-  a *= b;
-  a /= b;
-  
-  a += c;
-  a -= c;
-  a *= c;
-  a /= c;
-
-  int4 cmp;
-
-  cmp = a < b;
-  cmp = a <= b;
-  cmp = a < b;
-  cmp = a >= b;
-  cmp = a == b;
-  cmp = a != b;
-}
-
-void test7(int4 *ap, int4 *bp, int c) {
-  int4 a = *ap;
-  int4 b = *bp;
-  
-  a = a + b;
-  a = a - b;
-  a = a * b;
-  a = a / b;
-  a = a % b;
-  
-  a = a + c;
-  a = a - c;
-  a = a * c;
-  a = a / c;
-  a = a % c;
-
-  a += b;
-  a -= b;
-  a *= b;
-  a /= b;
-  a %= b;
-  
-  a += c;
-  a -= c;
-  a *= c;
-  a /= c;
-  a %= c;
-
-  int4 cmp;
-
-  cmp = a < b;
-  cmp = a <= b;
-  cmp = a < b;
-  cmp = a >= b;
-  cmp = a == b;
-  cmp = a != b;
-}

Removed: cfe/trunk/test/Parser/ocu_vector_components.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/ocu_vector_components.c?rev=61769&view=auto

==============================================================================
--- cfe/trunk/test/Parser/ocu_vector_components.c (original)
+++ cfe/trunk/test/Parser/ocu_vector_components.c (removed)
@@ -1,28 +0,0 @@
-// RUN: clang -fsyntax-only -verify %s
-
-typedef __attribute__(( ext_vector_type(2) )) float float2;
-typedef __attribute__(( ext_vector_type(3) )) float float3;
-typedef __attribute__(( ext_vector_type(4) )) float float4;
-
-static void test() {
-    float2 vec2, vec2_2;
-    float3 vec3;
-    float4 vec4, vec4_2;
-    float f;
-
-    vec2.z; // expected-error {{vector component access exceeds type 'float2'}}
-    vec2.rgba; // expected-error {{vector component access exceeds type 'float2'}}
-    vec4.rgba; // expected-warning {{expression result unused}}
-    vec4.rgbc; // expected-error {{illegal vector component name 'c'}}
-    vec3 = vec4.rgb; // legal, shorten
-    f = vec2.x; // legal, shorten
-    
-    vec4_2.rgbr = vec4.rgba; // expected-error {{vector is not assignable (contains duplicate components)}}
-    vec4_2.rgbb = vec4.rgba; // expected-error {{vector is not assignable (contains duplicate components)}}
-    vec4_2.rgga = vec4.rgba; // expected-error {{vector is not assignable (contains duplicate components)}}
-    vec2.x = f;
-    vec2.xx = vec2_2.xy; // expected-error {{vector is not assignable (contains duplicate components)}}
-    vec2.yx = vec2_2.xy;
-    vec4 = (float4){ 1,2,3,4 };
-    vec4.rg.a; // expected-error {{vector component access exceeds type 'float2'}}
-}





More information about the cfe-commits mailing list