Modified from https://github.com/ROCm/llvm-project/commit/7c2188cbc193f2b4dd5394f17404b44340001f30.patch
From 7c2188cbc193f2b4dd5394f17404b44340001f30 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault@amd.com>
Date: Thu, 4 Jan 2024 19:34:47 +0700
Subject: [PATCH] device-libs: Fix input file path test failures

The test file input paths broke with the move to the mono-repo. Some of
the constant folding values are host dependent, so update the values to
what works for me now. Not really sure what else I can do about these.

Change-Id: Ic764f637bb9532fcede9bfb9ce3886a2b7d467d8
---
 amd/device-libs/test/compile/frexp.cl       | 10 ++++++----
 amd/device-libs/test/compile/lgamma_r.cl    |  2 +-
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/test/compile/frexp.cl b/test/compile/frexp.cl
index 780c541500021b..b3181ce87db711 100644
--- a/test/compile/frexp.cl
+++ b/test/compile/frexp.cl
@@ -5,11 +5,11 @@
 // later.
 
 // GCN-LABEL: {{^}}test_frexp_f32:
-// GFX600-DAG: s_movk_i32 [[CLASS_MASK:s[0-9]+]], 0x1f8
+// GFX600-DAG: s_mov_b32 [[INF:s[0-9]+]], 0x7f80000
 // GFX600-DAG: v_frexp_mant_f32{{(_e32)?}} [[MANT:v[0-9]+]], [[SRC:v[0-9]+]]
 // GFX600-DAG: v_frexp_exp_i32_f32{{(_e32)?}} [[EXP:v[0-9]+]], [[SRC:v[0-9]+]]
 
-// GFX600-DAG: v_cmp_class_f32{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], [[SRC]], [[CLASS_MASK]]
+// GFX600-DAG: v_cmp_lt_f32{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], |[[SRC]]|, [[INF]]
 
 // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, [[SRC]], [[MANT]], [[CMP]]
 // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, 0, [[EXP]], [[CMP]]
@@ -30,12 +30,14 @@ kernel void test_frexp_f32(global float* restrict out0,
 }
 
 // GCN-LABEL: {{^}}test_frexp_f64:
+// GFX600: s_mov_b32 s{{[0-9]+}}, 0{{$}}
 
-// GFX600-DAG: s_movk_i32 [[CLASS_MASK:s[0-9]+]], 0x1f8
+// GFX600-DAG: s_mov_b32 s[[INF_LO:[0-9]+]], 0{{$}}
+// GFX600-DAG: s_mov_b32 s[[INF_HI:[0-9]+]], 0x7ff00000{{$}}
 // GFX600-DAG: v_frexp_mant_f64{{(_e32)?}} v{{\[}}[[MANT_LO:[0-9]+]]:[[MANT_HI:[0-9]+]]{{\]}}, [[SRC:v\[[0-9]+:[0-9]+\]]]
 // GFX600-DAG: v_frexp_exp_i32_f64{{(_e32)?}} [[EXP:v[0-9]+]], [[SRC:v\[[0-9]+:[0-9]+\]]]
 
-// GFX600-DAG: v_cmp_class_f64{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], [[SRC]], [[CLASS_MASK]]
+// GFX600-DAG: v_cmp_lt_f64{{(_e64)?}} [[CMP:(vcc|s{{\[[0-9]+:[0-9]+\]}})]], |[[SRC]]|, s{{\[}}[[INF_LO]]:[[INF_HI]]{{\]}}
 
 // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, v{{[0-9]+}}, v[[MANT_LO]], [[CMP]]
 // GFX600-DAG: v_cndmask_b32{{(_e32)?|(e64)?}} v{{[0-9]+}}, v{{[0-9]+}}, v[[MANT_HI]], [[CMP]]
diff --git a/test/compile/lgamma_r.cl b/test/compile/lgamma_r.cl
index 1e1984226cd55c..56d1ba15f761f2 100644
--- a/test/compile/lgamma_r.cl
+++ b/test/compile/lgamma_r.cl
@@ -66,7 +66,7 @@ kernel void constant_fold_lgamma_r_f32(volatile global float* out,
     out[0] = test_lgamma_r(0x1.0p-127f, sign_out);
 
     // CONSTANTFOLD-NEXT: store volatile i32 1,
-    // CONSTANTFOLD-NEXT: store volatile float 0x419DE28040000000,
+    // CONSTANTFOLD-NEXT: store volatile float 0x419DE28060000000,
     out[0] = test_lgamma_r(nextafter(0x1.0p+23f, __builtin_inff()), sign_out);
 
     // CONSTANTFOLD-NEXT: store volatile i32 1,
