Test: Add an option to select/deselect IRQ test cases

Some topologies and platforms don't support IRQ in TF-M yet. The
IRQ test should be temporarily skipped during test on those
topologies or platforms.
Add TFM_ENABLE_IRQ_TEST to select/deselect IRQ test cases.
Update the auto-generated files.

Change-Id: I6ce90fd15a8bc51bfd91741acd548bd471e43089
Signed-off-by: David Hu <david.hu@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index 01c637d..ee2faee 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -180,6 +180,20 @@
 	set(TFM_PARTITION_TEST_CORE ON)
 endif()
 
+if (TFM_PARTITION_TEST_CORE)
+	# If the platform or the topology doesn't specify whether IRQ test is
+	# supported, enable it by default.
+	if (NOT DEFINED TFM_ENABLE_IRQ_TEST)
+		set(TFM_ENABLE_IRQ_TEST ON)
+	endif()
+
+	if (TFM_ENABLE_IRQ_TEST)
+		add_definitions(-DTFM_ENABLE_IRQ_TEST)
+	endif()
+else()
+	set(TFM_ENABLE_IRQ_TEST OFF)
+endif()
+
 if (CORE_TEST_IPC)
 	add_definitions(-DCORE_TEST_IPC)
 	set(TEST_FRAMEWORK_NS ON)
diff --git a/interface/include/psa_manifest/sid.h b/interface/include/psa_manifest/sid.h
index ff3e99d..69fcfab 100644
--- a/interface/include/psa_manifest/sid.h
+++ b/interface/include/psa_manifest/sid.h
@@ -114,13 +114,13 @@
 #define IPC_CLIENT_TEST_MEM_CHECK_VERSION                          (1U)
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 /******** TFM_IRQ_TEST_1 ********/
 #define SPM_CORE_IRQ_TEST_1_PREPARE_TEST_SCENARIO_SID              (0x0000F0A0U)
 #define SPM_CORE_IRQ_TEST_1_PREPARE_TEST_SCENARIO_VERSION          (1U)
 #define SPM_CORE_IRQ_TEST_1_EXECUTE_TEST_SCENARIO_SID              (0x0000F0A1U)
 #define SPM_CORE_IRQ_TEST_1_EXECUTE_TEST_SCENARIO_VERSION          (1U)
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
 #ifdef __cplusplus
 }
diff --git a/interface/include/tfm_veneers.h b/interface/include/tfm_veneers.h
index 92856b3..0a24f47 100644
--- a/interface/include/tfm_veneers.h
+++ b/interface/include/tfm_veneers.h
@@ -117,11 +117,11 @@
 /******** TFM_SP_IPC_CLIENT_TEST ********/
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 /******** TFM_IRQ_TEST_1 ********/
 psa_status_t tfm_spm_irq_test_1_prepare_test_scenario_veneer(psa_invec *in_vec, size_t in_len, psa_outvec *out_vec, size_t out_len);
 psa_status_t tfm_spm_irq_test_1_execute_test_scenario_veneer(psa_invec *in_vec, size_t in_len, psa_outvec *out_vec, size_t out_len);
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
 #ifdef __cplusplus
 }
diff --git a/platform/ext/common/armclang/tfm_common_s.sct b/platform/ext/common/armclang/tfm_common_s.sct
index 6ec4e87..086d12b 100644
--- a/platform/ext/common/armclang/tfm_common_s.sct
+++ b/platform/ext/common/armclang/tfm_common_s.sct
@@ -136,13 +136,13 @@
     }
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
     TFM_IRQ_TEST_1 +0 ALIGN 32 {
         *tfm_irq_test_service_1.* (+RO)
         *timer_cmsdk* (+RO)
         *(TFM_IRQ_TEST_1_ATTR_FN)
     }
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
     /*
      * This empty, zero long execution region is here to mark the end address
@@ -345,7 +345,7 @@
 #endif
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
     TFM_IRQ_TEST_1_DATA +0 ALIGN 32 {
         *tfm_irq_test_service_1.* (+RW +ZI)
         *timer_cmsdk* (+RW +ZI)
@@ -357,7 +357,7 @@
     TFM_IRQ_TEST_1_STACK +0 ALIGN 128 EMPTY 0x0400 {
     }
 #endif
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
     /*
      * This empty, zero long execution region is here to mark the end address
diff --git a/platform/ext/common/gcc/tfm_common_s.ld b/platform/ext/common/gcc/tfm_common_s.ld
index 28cf587..ccb42e4 100644
--- a/platform/ext/common/gcc/tfm_common_s.ld
+++ b/platform/ext/common/gcc/tfm_common_s.ld
@@ -113,11 +113,11 @@
         LONG (ADDR(.TFM_SP_IPC_CLIENT_TEST_DATA))
         LONG (SIZEOF(.TFM_SP_IPC_CLIENT_TEST_DATA))
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
         LONG (LOADADDR(.TFM_IRQ_TEST_1_DATA))
         LONG (ADDR(.TFM_IRQ_TEST_1_DATA))
         LONG (SIZEOF(.TFM_IRQ_TEST_1_DATA))
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
         __copy_table_end__ = .;
     } > FLASH
 
@@ -204,14 +204,14 @@
         LONG (SIZEOF(.TFM_SP_IPC_CLIENT_TEST_STACK))
 #endif
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
         LONG (ADDR(.TFM_IRQ_TEST_1_BSS))
         LONG (SIZEOF(.TFM_IRQ_TEST_1_BSS))
 #if defined(TFM_PSA_API)
         LONG (ADDR(.TFM_IRQ_TEST_1_STACK))
         LONG (SIZEOF(.TFM_IRQ_TEST_1_STACK))
 #endif
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 #if !defined(TFM_PSA_API)
         LONG (ADDR(.TFM_UNPRIV_SCRATCH))
         LONG (SIZEOF(.TFM_UNPRIV_SCRATCH))
@@ -406,7 +406,7 @@
     Image$$TFM_SP_IPC_CLIENT_TEST$$Limit = ADDR(.TFM_SP_IPC_CLIENT_TEST) + SIZEOF(.TFM_SP_IPC_CLIENT_TEST);
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
     .TFM_IRQ_TEST_1 : ALIGN(32)
     {
         *tfm_irq_test_service_1.*(.text*)
@@ -420,7 +420,7 @@
     Image$$TFM_IRQ_TEST_1$$RO$$Limit = ADDR(.TFM_IRQ_TEST_1) + SIZEOF(.TFM_IRQ_TEST_1);
     Image$$TFM_IRQ_TEST_1$$Base = ADDR(.TFM_IRQ_TEST_1);
     Image$$TFM_IRQ_TEST_1$$Limit = ADDR(.TFM_IRQ_TEST_1) + SIZEOF(.TFM_IRQ_TEST_1);
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
     /**** APPLICATION RoT RO part (CODE + RODATA) end here */
     Image$$TFM_APP_CODE_END$$Base = .;
@@ -897,7 +897,7 @@
 
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
     .TFM_IRQ_TEST_1_DATA : ALIGN(32)
     {
         *tfm_irq_test_service_1.*(.data*)
@@ -931,7 +931,7 @@
     Image$$TFM_IRQ_TEST_1_STACK$$ZI$$Limit = ADDR(.TFM_IRQ_TEST_1_STACK) + SIZEOF(.TFM_IRQ_TEST_1_STACK);
 #endif
 
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
     /**** APPLICATION RoT DATA end here */
     Image$$TFM_APP_RW_STACK_END$$Base = .;
diff --git a/secure_fw/CMakeLists.txt b/secure_fw/CMakeLists.txt
index cad51b6..63a8ba3 100644
--- a/secure_fw/CMakeLists.txt
+++ b/secure_fw/CMakeLists.txt
@@ -263,6 +263,12 @@
 	endif()
 	embedded_set_target_link_includes(TARGET ${EXE_NAME} INCLUDES "${PLATFORM_LINK_INCLUDES}")
 
+	if (NOT DEFINED TFM_ENABLE_IRQ_TEST)
+		message(FATAL_ERROR "ERROR: Incomplete Configuration: TFM_ENABLE_IRQ_TEST is not defined.")
+	elseif (TFM_ENABLE_IRQ_TEST)
+		embedded_set_target_link_defines(TARGET ${EXE_NAME} DEFINES "TFM_ENABLE_IRQ_TEST")
+	endif()
+
 	#Generate binary file from executable
 	compiler_generate_binary_output(${EXE_NAME})
 
diff --git a/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc b/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc
index 999ee09..cc67b02 100644
--- a/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc
+++ b/secure_fw/core/ipc/tfm_secure_irq_handlers_ipc.inc
@@ -22,16 +22,16 @@
 
 /* Definitions of the signals of the IRQs (if any) */
 const struct tfm_core_irq_signal_data_t tfm_core_irq_signals[] = {
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
     { TFM_IRQ_TEST_1_ID, SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ, TFM_TIMER0_IRQ, 64 },
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 };
 
 const size_t tfm_core_irq_signals_count = sizeof(tfm_core_irq_signals) /
                                           sizeof(*tfm_core_irq_signals);
 
 /* Definitions of privileged IRQ handlers (if any) */
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 void TFM_TIMER0_IRQ_Handler(void)
 {
     __disable_irq();
@@ -42,5 +42,5 @@
     __enable_irq();
 }
 
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
diff --git a/secure_fw/core/tfm_secure_irq_handlers.inc b/secure_fw/core/tfm_secure_irq_handlers.inc
index 98da9f4..9c12be3 100644
--- a/secure_fw/core/tfm_secure_irq_handlers.inc
+++ b/secure_fw/core/tfm_secure_irq_handlers.inc
@@ -22,9 +22,9 @@
 
 /* Definitions of the signals of the IRQs */
 const struct tfm_core_irq_signal_data_t tfm_core_irq_signals[] = {
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
     { TFM_IRQ_TEST_1_ID, SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ, TFM_TIMER0_IRQ, 64 },
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 };
 
 const size_t tfm_core_irq_signals_count = sizeof(tfm_core_irq_signals) /
@@ -36,13 +36,13 @@
                                   uint32_t irq_line);
 
 /* Forward declarations of unpriv IRQ handlers*/
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 extern void SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ_isr(void);
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
 
 /* Definitions of privileged IRQ handlers */
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 void TFM_TIMER0_IRQ_Handler(void)
 {
     priv_irq_handler_main(TFM_IRQ_TEST_1_ID,
@@ -51,5 +51,5 @@
                           TFM_TIMER0_IRQ);
 }
 
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
diff --git a/secure_fw/ns_callable/tfm_veneers.c b/secure_fw/ns_callable/tfm_veneers.c
index 023ce36..fa8aacf 100644
--- a/secure_fw/ns_callable/tfm_veneers.c
+++ b/secure_fw/ns_callable/tfm_veneers.c
@@ -111,11 +111,11 @@
 /******** TFM_SP_IPC_CLIENT_TEST ********/
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 /******** TFM_IRQ_TEST_1 ********/
 psa_status_t spm_irq_test_1_prepare_test_scenario(psa_invec *, size_t, psa_outvec *, size_t);
 psa_status_t spm_irq_test_1_execute_test_scenario(psa_invec *, size_t, psa_outvec *, size_t);
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
 
 #define TFM_VENEER_FUNCTION(partition_name, sfn_name) \
@@ -231,9 +231,9 @@
 /******** TFM_SP_IPC_CLIENT_TEST ********/
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 /******** TFM_IRQ_TEST_1 ********/
 TFM_VENEER_FUNCTION(TFM_IRQ_TEST_1, spm_irq_test_1_prepare_test_scenario)
 TFM_VENEER_FUNCTION(TFM_IRQ_TEST_1, spm_irq_test_1_execute_test_scenario)
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
diff --git a/secure_fw/services/tfm_partition_defs.inc b/secure_fw/services/tfm_partition_defs.inc
index bf195a3..b81f8c5 100644
--- a/secure_fw/services/tfm_partition_defs.inc
+++ b/secure_fw/services/tfm_partition_defs.inc
@@ -44,9 +44,9 @@
 #define TFM_SP_IPC_CLIENT_TEST_ID (TFM_SP_BASE + 9)
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 #define TFM_IRQ_TEST_1_ID (TFM_SP_BASE + 10)
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
 #define TFM_MAX_USER_PARTITIONS (11)
 
diff --git a/secure_fw/services/tfm_service_list.inc b/secure_fw/services/tfm_service_list.inc
index 3ff8d7b..08ffd7d 100644
--- a/secure_fw/services/tfm_service_list.inc
+++ b/secure_fw/services/tfm_service_list.inc
@@ -608,7 +608,7 @@
     },
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
     /******** TFM_IRQ_TEST_1 ********/
     {
         .service_db = {
@@ -640,7 +640,7 @@
         .msg_queue = {0},
         .list = {0},
     },
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
 };
 #endif /* __TFM_SERVICE_LIST_INC__ */
diff --git a/secure_fw/services/tfm_spm_db.inc b/secure_fw/services/tfm_spm_db.inc
index afd17fd..c531fc6 100644
--- a/secure_fw/services/tfm_spm_db.inc
+++ b/secure_fw/services/tfm_spm_db.inc
@@ -49,9 +49,9 @@
 #define TFM_PARTITION_TFM_SP_IPC_CLIENT_TEST_IRQ_COUNT 0
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 #define TFM_PARTITION_TFM_IRQ_TEST_1_IRQ_COUNT 1
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
 /**************************************************************************/
 /** Declarations of partition init functions */
@@ -90,9 +90,9 @@
 extern int32_t ipc_client_test_main(void);
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 extern int32_t tfm_irq_test_1_init(void);
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
 /**************************************************************************/
 /** Memory region declarations */
@@ -221,7 +221,7 @@
 REGION_DECLARE(Image$$, TFM_SP_IPC_CLIENT_TEST, _STACK$$ZI$$Limit);
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, $$Base);
 REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, $$Limit);
 REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, $$RO$$Base);
@@ -232,7 +232,7 @@
 REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, _DATA$$ZI$$Limit);
 REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, _STACK$$ZI$$Base);
 REGION_DECLARE(Image$$, TFM_IRQ_TEST_1, _STACK$$ZI$$Limit);
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
 #ifndef TFM_PSA_API
 /**************************************************************************/
@@ -331,14 +331,14 @@
         )) / sizeof(uint32_t)];
 #endif /* TFM_PARTITION_TEST_CORE_IPC */
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 static uint32_t ctx_stack_TFM_IRQ_TEST_1[
         (sizeof(struct interrupted_ctx_stack_frame_t) +
             (TFM_PARTITION_TFM_IRQ_TEST_1_IRQ_COUNT) * (
                 sizeof(struct interrupted_ctx_stack_frame_t) +
                 sizeof(struct handler_ctx_stack_frame_t)
         )) / sizeof(uint32_t)];
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
 #endif /* !defined(TFM_PSA_API) */
 
@@ -1209,7 +1209,7 @@
     /* -----------------------------------------------------------------------*/
     /* - Partition DB record for TFM_IRQ_TEST_1 */
     /* -----------------------------------------------------------------------*/
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
     {
     /* Static data */
         {
@@ -1291,7 +1291,7 @@
         },
 #endif /* defined(TFM_PSA_API) */
     },
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 
 };
 
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 494003a..2354c2c 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -42,15 +42,23 @@
 	message(FATAL_ERROR "Incomplete build configuration: TFM_PARTITION_AUDIT_LOG is undefined.")
 endif()
 
+if (NOT DEFINED TFM_ENABLE_IRQ_TEST)
+	message(FATAL_ERROR "Incomplete build configuration: TFM_ENABLE_IRQ_TEST is undefined.")
+endif()
+
 #Configure our options as needed.
 if (CORE_TEST_INTERACTIVE OR CORE_TEST_POSITIVE)
 	set(ENABLE_CORE_TESTS True)
 	set(ENABLE_CORE_TESTS_2 True)
-	set(ENABLE_IRQ_TEST_SERVICES True)
 else()
 	set(ENABLE_CORE_TESTS False)
 	set(ENABLE_CORE_TESTS_2 False)
-	set(ENABLE_IRQ_TEST_SERVICES False)
+endif()
+
+if (TFM_ENABLE_IRQ_TEST)
+	set(ENABLE_IRQ_TEST_SERVICES ON)
+else()
+	set(ENABLE_IRQ_TEST_SERVICES OFF)
 endif()
 
 set(ENABLE_SECURE_STORAGE_SERVICE_TESTS TRUE)
diff --git a/test/suites/core/non_secure/core_ns_positive_testsuite.c b/test/suites/core/non_secure/core_ns_positive_testsuite.c
index 34a721c..cde5890 100644
--- a/test/suites/core/non_secure/core_ns_positive_testsuite.c
+++ b/test/suites/core/non_secure/core_ns_positive_testsuite.c
@@ -13,12 +13,14 @@
 #include "tfm_plat_test.h"
 #include "test/suites/core/non_secure/core_test_api.h"
 #include "test/test_services/tfm_core_test/core_test_defs.h"
-#include "platform_irq.h"
 #ifdef TFM_PSA_API
 #include "psa_manifest/sid.h"
 #else  /* TFM_PSA_API */
 #include "tfm_veneers.h"
 #endif /* TFM_PSA_API */
+#ifdef TFM_ENABLE_IRQ_TEST
+#include "platform_irq.h"
+#endif
 
 /* Define test suite for core tests */
 /* List of tests */
@@ -44,10 +46,12 @@
 static void tfm_core_test_peripheral_access(struct test_result_t *ret);
 static void tfm_core_test_iovec_sanitization(struct test_result_t *ret);
 static void tfm_core_test_outvec_write(struct test_result_t *ret);
+#ifdef TFM_ENABLE_IRQ_TEST
 static void tfm_core_test_irq(struct test_result_t *ret);
 
 static enum irq_test_scenario_t executing_irq_test_scenario = IRQ_TEST_SCENARIO_NONE;
 static struct irq_test_execution_data_t irq_test_execution_data = {0};
+#endif
 
 static struct test_t core_tests[] = {
 CORE_TEST_DESCRIPTION(CORE_TEST_ID_NS_THREAD, tfm_core_test_ns_thread,
@@ -61,9 +65,11 @@
     tfm_core_test_permissions,
     "Test secure service memory access permissions"),
 #endif /* TFM_PSA_API */
+#ifdef TFM_ENABLE_IRQ_TEST
 CORE_TEST_DESCRIPTION(CORE_TEST_ID_SECURE_IRQ,
     tfm_core_test_irq,
     "Test secure irq"),
+#endif
 #ifndef TFM_PSA_API
 CORE_TEST_DESCRIPTION(CORE_TEST_ID_MPU_ACCESS, tfm_core_test_mpu_access,
     "Test secure service MPU accesses"),
@@ -433,6 +439,7 @@
     ret->val = TEST_PASSED;
 }
 
+#ifdef TFM_ENABLE_IRQ_TEST
 static int32_t prepare_test_scenario_ns(
                                enum irq_test_scenario_t test_scenario,
                                struct irq_test_execution_data_t *execution_data)
@@ -617,6 +624,7 @@
 
     ret->val = TEST_PASSED;
 }
+#endif
 
 /*
  * \brief Tests whether the initialisation of the service was successful.
diff --git a/test/test_services/tfm_irq_test_service_1/psa_manifest/tfm_irq_test_service_1.h b/test/test_services/tfm_irq_test_service_1/psa_manifest/tfm_irq_test_service_1.h
index 585169f..9fd113c 100644
--- a/test/test_services/tfm_irq_test_service_1/psa_manifest/tfm_irq_test_service_1.h
+++ b/test/test_services/tfm_irq_test_service_1/psa_manifest/tfm_irq_test_service_1.h
@@ -14,13 +14,13 @@
 extern "C" {
 #endif
 
-#ifdef TFM_PARTITION_TEST_CORE
+#ifdef TFM_ENABLE_IRQ_TEST
 #define SPM_CORE_IRQ_TEST_1_PREPARE_TEST_SCENARIO_SIGNAL        (1U << ( 0 + 4))
 #define SPM_CORE_IRQ_TEST_1_EXECUTE_TEST_SCENARIO_SIGNAL        (1U << ( 1 + 4))
 
 #define SPM_CORE_IRQ_TEST_1_SIGNAL_TIMER_0_IRQ                  (1U << (27 + 4))
 
-#endif /* TFM_PARTITION_TEST_CORE */
+#endif /* TFM_ENABLE_IRQ_TEST */
 #ifdef __cplusplus
 }
 #endif
diff --git a/tools/tfm_manifest_list.yaml b/tools/tfm_manifest_list.yaml
index 7d1904a..c0a65ce 100644
--- a/tools/tfm_manifest_list.yaml
+++ b/tools/tfm_manifest_list.yaml
@@ -114,7 +114,7 @@
       "manifest": "test/test_services/tfm_irq_test_service_1/tfm_irq_test_service_1.yaml",
       "tfm_extensions": true,
       "tfm_partition_ipc": true,
-      "conditional": "TFM_PARTITION_TEST_CORE",
+      "conditional": "TFM_ENABLE_IRQ_TEST",
       "version_major": 0,
       "version_minor": 1
     }